var cph = '',openid='';
$(function(){
	layer.open({ content: '  根据常态化防控期间停车费优惠政策，如遇疫情防控发生停放费用请向道路停车协管单位（或协管员）提供有效的封闭管理证明用以申请优惠价格。具体详见《关于新冠疫情防控期间减免部分公共停车费用的通知》',btn: '好的，我知道了',function(){layer.closeAll(); }}); 
	openid = $('#openid').val();
	if(openid!=null&&openid!=''){
		localStorage.setItem("openid",openid);
	}else{
		openid = localStorage.getItem("openid");
	}
	if(openid==''||openid==null){
		location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3a8350d9178db579&redirect_uri=https://ipc.csnits.com/park/redirect1&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect';
	}else{
		localStorage.setItem("openid",openid);
	}
	$.ajax({
		url: '/park/data/getUserInfo?openid='+openid+'&type=2',
		type: 'post',
		dataType: 'json',
		success: function(res) {
			if(res.data!=null){
				cph = res.data.cph;
				var arr = cph.split('');
				for(var i in arr){
					var x = parseInt(i)+1;
					$('#p'+x).html(arr[i]);
				}
			}
		}
	})
})
function backUp(){
	$('#main').show();
	$('#fuck').hide();
}
var orderNo = '';
var parkTimes = 0;
function select() {
	var cph = $('#p1').text()+$('#p2').text()+$('#p3').text()+$('#p4').text()+$('#p5').text()+$('#p6').text()+$('#p7').text();
	var p8=$('#p8').html();
	if(p8.indexOf('绿牌')>-1){
		
	}else{
		cph+=p8;
	}
	layer.open({
	    content:'查询中，请稍后...'
	    ,skin: 'msg'
	    ,time: 2 //2秒后自动关闭
	  });
	$.ajax({
		url : '/park/road/data/getRoadParking',
		data : 'carLicense=' + cph+'&openid='+openid,
		type : 'post',
		dataType : 'json',
		success : function(res) {
			if(res.data.status=='0'&&res.data.attr.result!=null){
				var orderNo = res.data.attr.result[0].orderNo;
				location.href = '/park/r_prePay?orderNo='+orderNo;
			}else{
				 layer.open({
				    content:res.data.msg
				    ,skin: 'msg'
				    ,time: 2 //2秒后自动关闭
				  });
			}
		}
	})
}
